#pragma once

#include <d3d10.h>
#include <d3dx10.h>
#include "EngineObject.h"
#include "EnginePointer.h"

#define MAX_MATERIAL_NAME 100
#define MAX_TEXTURE_NAME MAX_PATH
#define MAX_MATERIAL_PATH MAX_PATH

class Material : public EngineObject
{
public:
	Material(char* name, char* diffuseTexture, char* normalTexture, char* specularTexture);

	HRESULT LoadGraphicsContent(EnginePointer<ID3D10Device>& pDevice);
	void UnloadGraphicsContent();
	ID3D10ShaderResourceView* getDiffuseView();
	ID3D10ShaderResourceView* getNormalView();
	ID3D10ShaderResourceView* getSpecularView();
	AUTO_SIZE;
private:
	char name[MAX_MATERIAL_NAME];

    // Or fall back to d3d8-type materials
    char diffuseTexture[MAX_TEXTURE_NAME];
    char normalTexture[MAX_TEXTURE_NAME];
    char specularTexture[MAX_TEXTURE_NAME];

    ID3D10Texture2D* pDiffuseTexture;
    ID3D10Texture2D* pNormalTexture;
    ID3D10Texture2D* pSpecularTexture;
	ID3D10ShaderResourceView* pDiffuseView;
	ID3D10ShaderResourceView* pNormalView;
	ID3D10ShaderResourceView* pSpecularView;
};
